<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="utf-8">
    <title>网上图书馆</title>
    <headers>
        <frame-options policy="SAMEORIGIN" />
    </headers>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/css/AdminLTE.css}">
    <link rel="stylesheet" th:href="@{/css/_all-skins.min.css}">
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.js}"></script>
    <script type="text/javascript">
        function SetIFrameHeight() {
            var iframeid = document.getElementById("iframe");
            if (document.getElementById) {
                /*设置 内容展示区的高度等于页面可视区的高度*/
                iframeid.height = document.documentElement.clientHeight;
            }
        }
    </script>
</head>

<body class="hold-transition skin-green sidebar-mini">
<div class="wrapper">
    <!-- 页面头部 -->
    <header class="main-header">
        <!-- Logo -->
        <a th:href="@{/}" class="logo">
            <span class="logo-lg"><b>网上图书馆</b></span>
        </a>
        <!-- 头部导航 -->
        <nav class="navbar navbar-static-top">
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="dropdown user user-menu">
                        <a  th:if="${session.user !=null}">
                            <img th:src="@{/img/user.jpg}" class="user-image"
                                 alt="User Image">
                            <span class="hidden-xs" th:text="${session.user.name}"></span>
                        </a>
                    </li>
                    <li class="dropdown user user-menu">
                        <a th:href="@{/logout}">
                            <span class="hidden-xs">注销</span>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- 页面头部 /-->
    <!-- 导航侧栏 -->
    <aside class="main-sidebar">
        <section class="sidebar">
            <ul class="sidebar-menu">
                <li>
                    <a th:href="@{/book/list}" target="iframe">
                        <i class="fa fa-circle-o"></i>图书阅读
                    </a>
                </li>
                <li>
                    <a th:href="@{/book/admin/manag}" target="iframe">
                        <i class="fa fa-circle-o"></i>图书管理
                    </a>
                </li>
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- 导航侧栏 /-->
    <!-- 内容展示区域 -->
    <div class="content-wrapper">
        <iframe width="100%" id="iframe" name="iframe" onload="SetIFrameHeight()"
                frameborder="0" ></iframe>
    </div>
</div>
</body>
</html>